<template>
    <div id="data-view">
        <dv-full-screen-container>
            <topHeader />
            <dv-border-box-1 class="main-container">
                <dv-border-box-3 class="left-chart-container">
                    <!-- <leftTotalStat /> -->
                    <leftContent @finish="finish" />
                </dv-border-box-3>
                <div class="right-chart-contrainer">
                    <dv-border-box-10 class="top">
                        <topStat @finish="finish" />
                    </dv-border-box-10>
                    <div class="bottom">
                        <div class="content-stat" v-for="(item, index) in project" :key="index">
                            <dv-border-box-12>
                                <categoryStat
                                    :category="item.category"
                                    :title="item.label"
                                    @finish="finish"
                                />
                            </dv-border-box-12>
                        </div>
                        <div class="place-stat" v-for="(item, index) in places" :key="index">
                            <dv-border-box-12>
                                <placeStat
                                    :category="item.category"
                                    :title="item.label"
                                    @finish="finish"
                                />
                            </dv-border-box-12>
                        </div>
                    </div>
                </div>
            </dv-border-box-1>
            <bottomFooter />
        </dv-full-screen-container>
    </div>
</template>

<script setup>
import { ref } from 'vue'
import topHeader from './topHeader'
// import leftTotalStat from './leftTotalStat'
import leftContent from './scrollBoard'
import topStat from './topStat'
import categoryStat from './categoryStat'
import placeStat from './placeStat'
import bottomFooter from './bottomFooter'
import { ElLoading } from 'element-plus'

const count = ref(0)

const loadingInstance = ElLoading.service({
    fullscreen: true,
})

const finish = () => {
    count.value++
    console.log('count=>', count.value)
    if (count.value == 6) {
        loadingInstance.close()
    }
}

const project = ref([
    {
        label: '沿街商铺',
        category: '118',
    },
    {
        label: '非经营性',
        category: '119',
    },
])

const places = ref([
    {
        label: '夜市',
        category: '117',
    },
    {
        label: '商业综合体',
        category: '213',
    },
])
</script>

<style lang="less">
#data-view {
    width: 100%;
    height: 100%;
    background-color: #030409;
    color: #fff;

    #dv-full-screen-container {
        background-image: url('./img/bg.png');
        background-size: 100% 100%;
        box-shadow: 0 0 3px blue;
        display: flex;
        flex-direction: column;
    }

    .main-content {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .block-left-right-content {
        flex: 1;
        display: flex;
        margin-top: 20px;
    }

    .block-top-bottom-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
        padding-left: 20px;
    }

    .block-top-content {
        height: 55%;
        display: flex;
        flex-grow: 0;
        box-sizing: border-box;
        padding-bottom: 20px;
    }

    .main-container {
        height: calc(100vh - 130px);

        .border-box-content {
            padding: 20px;
            box-sizing: border-box;
            display: flex;
        }
    }
    .left-chart-container {
        width: 22%;
        padding: 10px;
        box-sizing: border-box;
        height: 100%;

        .border-box-content {
            flex-direction: column;
        }
    }

    .right-chart-contrainer {
        width: 78%;
        padding: 10px;
        box-sizing: border-box;
        height: 100%;
        display: flex;
        flex-direction: column;

        .top {
            height: 300px;
            margin-bottom: 5px;
            width: 100%;
            display: flex;
            flex-direction: row;
        }

        .bottom {
            height: calc(100% - 300px);
            width: 100%;
            display: flex;
            flex-direction: row;

            .content-stat {
                width: 20%;
                padding-right: 15px;
            }

            .place-stat {
                width: 30%;
                padding-right: 15px;
            }

            .place-stat:last-child {
                padding-right: 0;
            }
        }
    }
}
</style>
